/*
    PhotoFlip, a free 3d photo managment suite.
    Copyright (C) 2007  Elisée MAURER, Gaétan WALTER
    
    This file is part of PhotoFlip.
    Contact: http://www.photoflip.org/

    PhotoFlip is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    PhotoFlip is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PhotoFlip.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef PHOTOFLIP_HPP_INCLUDED
#define PHOTOFLIP_HPP_INCLUDED

#include "glarea.hpp"
#include "library.hpp"
#include "visualisation.hpp"

#include <gtkmm.h>
#include <libglademm/xml.h>

//! Photoflip root class
/*!
  This class is responsible for connecting most GTK+ signals (menus, buttons...)
  and linking the program's main components: the library, the OpenGL area,
  the current visualisation and our Glade surrounding interface.
*/
class photoflip {
	private:
		library m_lib;
		GLArea m_gl;
		visualisation *m_visu;

		Gtk::Window *m_mainWindow;
		Gtk::FileChooserDialog *m_fileImportDialog;
		Gtk::AboutDialog *m_aboutDialog;
		Gtk::Dialog *m_photoDeletionDialog;
		
		// menu bar
		Gtk::MenuBar *m_menuBar;
		Gtk::CheckMenuItem *m_menuItemFullscreen;
		Gtk::CheckMenuItem *m_menuItemShowControls;
		
		Gtk::RadioMenuItem *m_menuItemVisuCircular,
			*m_menuItemVisuStrew,
			*m_menuItemVisuFold;
		
		Gtk::CheckMenuItem *m_menuItemShowFrames;
		// toolbar
		Gtk::Toolbar *m_toolbar;
		Gtk::ToggleToolButton *m_toolButtonFullscreen;
		// popup menu
		Gtk::Menu *m_popupMenuView, *m_popupMenuPhoto, *m_menuFrame;
		// statusbar
		Gtk::Statusbar *m_statusbar;
	public:
		photoflip(Glib::RefPtr<Gnome::Glade::Xml> refXml);
		~photoflip();
		
		Gtk::Window& getWindow() const { return *m_mainWindow; }
		
		void rien();
		
		// menubar
		void fileImport();
		void fileImportResponse(int response);
		void menuFullscreen();
		void showControls();
		void setVisualisation();
		void showFrames();
		void deletePhoto();
		void deletePhotoResponse(int response);
		void about();
		void aboutResponse(int response);
		
		// toolbar
		void fullscreen();
		void quit();
		void back();
		void forward();
		void zoomIn();
		void zoomOut();
};

#endif // PHOTOFLIP_HPP_INCLUDED
